package net.form.processing;

import java.util.List;

import net.form.processing.classification.ObjectReference;

public class ClusterVectorPartido extends ClusterVector {

	public ClusterVectorPartido(int id, String heft, List<Cluster1> properties,
			int tolerancePercentage) {
		super(id, heft, properties, tolerancePercentage);
	}

	public double distance(List<Cluster1> valor) {
		double dif = 0;
		for (int i = 0; i < properties.size(); i++) {
			Cluster1 cv = properties.get(i);
			double d1 = cv.getValue();
			double d2 = getValor(valor,cv.getRasgo());
			if(cv.getRasgo().equals("DIAMETRO"))
				if(d2<ObjectReference.getDiametroZaranda().doubleValue())
					d2=d1;
			
			dif = dif + Math.abs(d1 - d2);
		}
		return dif;
	}
}
